package com.tengju.motivation.domain.model.activity;

import lombok.AllArgsConstructor;

@AllArgsConstructor
public enum ActivityUserType {

    VTN(10, "VTN"),
    ABM(20, "ABM"),
    ;

    private final Integer val;
    private final String desc;

    public Integer getVal() {
        return val;
    }

    public String getDesc() {
        return desc;
    }

    public static ActivityUserType fromVal(Integer val) {
        for (ActivityUserType type : values()) {
            if (type.val.equals(val)) {
                return type;
            }
        }
        return null;
    }

    public static ActivityUserType fromName(String name) {
        for (ActivityUserType type : values()) {
            if (type.name().equals(name)) {
                return type;
            }
        }
        return null;
    }

}
